package com.wd.live.module_wide.viewmodel

import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.wd.live.module_base.net.bean.wide.FindRecommendConstellationBean
import com.wd.live.module_base.net.util.HttpUtils2
import com.wd.live.module_base.ui.base.BaseResult
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext

/**
 * 作者: 王晶晶
 * 时间:2024/5/27
 * 描述:
 */
class ConstellationViewModel:ViewModel() {
    val dataConstellation=MutableLiveData<BaseResult<List<FindRecommendConstellationBean>>>()
    fun getFindRecommendConstellation(
        count:Int
        ,maxFriendId:Int){
        viewModelScope.launch(Dispatchers.IO) {
            var result=HttpUtils2.apiService.getFindRecommendConstellation(count,maxFriendId)
            if (result.status =="0000"){
                dataConstellation.postValue(result)
            }

        }
    }
}